package com.concise.appapi.controller;

import com.concise.appapi.util.SiteUtil;
import com.initialize.pub.dao.SiteDAO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: concise-blog
 * @description: 站点信息控制器
 * @author: Mr.Jane
 * @create: 2019-10-13 14:28
 **/

@CrossOrigin
@Api(tags = "站点信息API")
@RestController
@RequestMapping(value = "/site")
public class SiteInformationController {
    final
    SiteDAO siteDAO;

    public SiteInformationController(SiteDAO siteDAO) {
        this.siteDAO = siteDAO;
    }

    @ApiOperation(value = "获取站点标题")
    @GetMapping("/site_title")
    public String getSiteTitle() {
        return siteDAO.getSiteTitle(SiteUtil.SITE_TITLE);
    }

    @ApiOperation(value = "获取站点小标题")
    @GetMapping("/site_subheading")
    public String getsTheSiteSubtitle() {
        return siteDAO.getSiteTitle(SiteUtil.SITE_SUBHEADING);
    }

    @ApiOperation(value = "获取站点页脚信息")
    @GetMapping("/site_footer_information")
    public String getSiteFooterInformation() {
        return siteDAO.getSiteTitle(SiteUtil.SITE_FOOTER_INFORMATION);
    }


    @ApiOperation(value = "获取站点关于信息")
    @GetMapping("/site_about")
    public String getSiteInformation() {
        return siteDAO.getSiteTitle(SiteUtil.SITE_ABOUT);
    }
}
